<div id='titleHead'>	
  <h1><%= @petrinet.name %></h1>
</div>
<div class='documentation'>		
</div>
<span id="debug_mode" class="metadata"><%= Merb::Config[:gui_debug].to_s %></span>
<div class='container'>
  <h3>Worklist - Please choose an activity</h3>
  <a id="toggle_debug" href="javascript:toggleDebug()">Debug</a>
  <% @petrinet.transitions.find(:all, :order => "name ASC").each do |transition| %>
  <% class_name = 'innerContainer' %>
  <% class_name += ' debug' unless transition.active?(:case => @case) %>
  <div class='<%= class_name %>' >
      <h5>
          <%= image_tag((transition.active?(:case => @case) ? "famfamfam/flag_green.png" : "famfamfam/flag_red.png"))%>
		  <%= image_tag((transition.eval_role ? "famfamfam/user_green.png" : "famfamfam/user_red.png"))%>
		  <%= image_tag((transition.eval_owner ? "famfamfam/user_green.png" : "famfamfam/user_red.png"))%>
          <a href="<%= transition.url(:case => @case)%>"><%= transition.name || "Unlabeled" %></a>
      </h5>
	  <% if transition.kind_of?(SendTransition) && !transition.send_to_locator%>
	  	Send to
        <%if transition.send_to.nil?%>
          <form id="transition_update_form_<%=transition.id%>" action="<%= url(:transition, transition) %>')">
            <input type="text" name="transition[send_to]" />
			<button type="button" onclick="performUpdate('transition_update_form_<%=transition.id%>')">
				Save
	   		</button>
          </form>
        <%else%>
            <input type="text" value="<%=transition.send_to%>" readonly="readonly" />
        <%end%>
	  <% end %>
  </div>
  <% end %>
</div>
<div class='container debug'>
    <h3>Places</h3>
    <% @petrinet.places.find(:all, :order => "name ASC").each do |place| %>
      <div class='innerContainer' id="placeList">
        <h5><a href="<%= url(:place, place) %>" <%='class="external"' if place.is_a?(ExternalPlace) %> ><%= place.name || "Unnamed Place #{place.id}" %></a></h5>
      </div>
    <% end %>
</div>
